/*
    2. Write a program in C to compute the number of seconds passed since the beginning of the month. 
    Expected Output :

    222084 seconds passed since the beginning of the month.
*/

#include <time.h>
#include <stdio.h>

int main(void)
{
    time_t rawtime;
    time_t secpss;
    struct tm *info;
    time(&rawtime);
    info = localtime(&rawtime);
    secpss = (info->tm_mday - 1) * 24 * 60 * 60 + info->tm_hour * 60 * 60 + info->tm_min * 60 + info->tm_sec;
    printf("Current time is %s", asctime(info));
    printf("%d seconds passed since the beginning of the month.", secpss);

    return 0;
}